<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopShopManualsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_shop_manuals', function (Blueprint $table) {
            $table->id();
            $table->string('orderNo')->default('')->index('orderNo')->comment('订单编号');
            $table->unsignedTinyInteger('type')->default(1)->comment('1-手册类, 2-夸父资质，3-授权书，4-信息披露单');
            $table->unsignedTinyInteger('weight')->default(1)->comment('越小越靠前');
            $table->string('shopCode', 8)->default('')->index('shopCode')->comment('店铺编码');
            $table->string('name', 128)->default('')->comment('展示的文件名');
            $table->string('version', 32)->default('')->comment('用户类pdf版本号，用于后期批量更新用');
            $table->string('url', 128)->default('')->comment('公开的OSS文件路径地址');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '用户PDF类手册、信息披露单 表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_shop_manuals');
    }
}
